/*
 * seminit.cpp
 *
 *  Created on: Jul 14, 2013
 *      Author: m
 */

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include "NewSemaphore.h"

using namespace ipc;

int main ( void )
{
    char mostrar[10240];
    //Semaphore sem;

    Semaphore sem = Semaphore::create( "/tmp/mysem", 'a', 5 );

    sem.initialize( 0 );

    sprintf( mostrar,
            "SEMINIT: "
            "Semaphore Array initialized.\n" );
    write( fileno(stdout), mostrar, strlen(mostrar) );

    return 0;
}
